﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FirstGame.Objects
{
    public class MovingObject
    {
        public Texture2D Sprite { get; set; }
        public Vector2 Position { get; set; }
        public Vector2 Speed { get; set; }
        public BoundingBox BoundingBox { get; set; }

        protected void SetBoundingBox()
        {
            BoundingBox = new BoundingBox(new Vector3(Position.X, Position.Y, 0), new Vector3(Position.X + Sprite.Width, Position.Y + Sprite.Height, 0));
        }

        protected void UpdateObject()
        {
            Position += Speed;
            SetBoundingBox();
        }
    }
}
